(map-y-or-n-p): Handle `quit' as answer.
authorRichard M. Stallman <rms@gnu.org>
Tue, 9 Mar 1993 21:17:46 +0000 (21:17 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 9 Mar 1993 21:17:46 +0000 (21:17 +0000)
lisp/map-ynp.el

index e79e47fa664bb9a0710a4bc559cb354fe112fbf9..c3cce3abc0772efd483b50380c7b1a939584fd82 100644 (file)
@@ -111,6 +111,7 @@ Returns the number of actions taken."
       (setq prompt (funcall prompter elt))
       (if (stringp prompt)
          (progn
+           (setq quit-flag nil)
            ;; Prompt the user about this object.
            (let ((cursor-in-echo-area t))
              (message "%s(y, n, !, ., q, %sor %s) "
@@ -132,6 +133,11 @@ Returns the number of actions taken."
                   (funcall actor elt)
                   (setq actions (1+ actions)
                         next (function (lambda () nil))))
+                 ((eq def 'quit)
+                  (setq quit-flag t)
+                  (setq next (` (lambda ()
+                                  (setq next '(, next))
+                                  '(, elt)))))
                  ((eq def 'automatic)
                   ;; Act on this and all following objects.
                   (if (eval (funcall prompter elt))